﻿using Microsoft.Xna.Framework.Input;

namespace Serious
{
    public struct KeyboardEvent
    {
        public KeyboardState Current;
        public KeyboardState Previous;

        public KeyboardEvent(KeyboardState current, KeyboardState previous)
        {
            Current = current;
            Previous = previous;
        }

        public bool IsKeyDown(Keys key)
        {
            return Current.IsKeyDown(key);
        }
        public bool IsKeyUp(Keys key)
        {
            return Current.IsKeyUp(key);
        }

        public bool WasKeyPressed(Keys key)
        {
            return Current.IsKeyDown(key) && !Previous.IsKeyDown(key);
        }
        public bool WasKeyReleased(Keys key)
        {
            return Current.IsKeyUp(key) && !Previous.IsKeyUp(key);
        }
    }
}
